define_cz([], [], []).

masc_cz(masca).
masc_cz(masci).
masc_neut_cz(masca).
masc_neut_cz(masci).
masc_neut_cz(neut).

gen_cz(masca).
gen_cz(masci).
gen_cz(fem).
gen_cz(neut).

case_cz(nom).
case_cz(gen).
case_cz(dat).
case_cz(acc).
case_cz(inst).
case_cz(loc).
case_cz(voc).

item(Index, Ort, [case==nom, gen==M, num==sg]) :- masc_cz(M), define_cz(Index, Root, adjh), text_concat(Root, 'ý', Ort).
item(Index, Ort, [case==nom, gen==neut, num==sg]) :- define_cz(Index, Root, adjh), text_concat(Root, 'é', Ort).
item(Index, Ort, [case==gen, gen==M, num==sg]) :- masc_neut_cz(M), define_cz(Index, Root, adjh), text_concat(Root, 'ého', Ort).
item(Index, Ort, [case==dat, gen==M, num==sg]) :- masc_neut_cz(M), define_cz(Index, Root, adjh), text_concat(Root, 'ému', Ort).
item(Index, Ort, [case==acc, gen==masca, num==sg]) :- define_cz(Index, Root, adjh), text_concat(Root, 'ého', Ort).
item(Index, Ort, [case==acc, gen==masci, num==sg]) :- define_cz(Index, Root, adjh), text_concat(Root, 'ý', Ort).
item(Index, Ort, [case==acc, gen==neut, num==sg]) :- define_cz(Index, Root, adjh), text_concat(Root, 'é', Ort).
item(Index, Ort, [case==inst, gen==M, num==sg]) :- masc_neut_cz(M), define_cz(Index, Root, adjh), text_concat(Root, 'ým', Ort).
item(Index, Ort, [case==loc, gen==M, num==sg]) :- masc_neut_cz(M), define_cz(Index, Root, adjh), text_concat(Root, 'ém', Ort).
item(Index, Ort, [case==voc, gen==M, num==sg]) :- masc_cz(M), define_cz(Index, Root, adjh), text_concat(Root, 'ý', Ort).
item(Index, Ort, [case==voc, gen==neut, num==sg]) :- define_cz(Index, Root, adjh), text_concat(Root, 'é', Ort).

item(Index, Ort, [case==nom, gen==fem, num==sg]) :- define_cz(Index, Root, adjh), text_concat(Root, 'á', Ort).
item(Index, Ort, [case==gen, gen==fem, num==sg]) :- define_cz(Index, Root, adjh), text_concat(Root, 'é', Ort).
item(Index, Ort, [case==dat, gen==fem, num==sg]) :- define_cz(Index, Root, adjh), text_concat(Root, 'é', Ort).
item(Index, Ort, [case==acc, gen==fem, num==sg]) :- define_cz(Index, Root, adjh), text_concat(Root, 'ou', Ort).
item(Index, Ort, [case==inst, gen==fem, num==sg]) :- define_cz(Index, Root, adjh), text_concat(Root, 'ou', Ort).
item(Index, Ort, [case==loc, gen==fem, num==sg]) :- define_cz(Index, Root, adjh), text_concat(Root, 'é', Ort).
item(Index, Ort, [case==voc, gen==fem, num==sg]) :- define_cz(Index, Root, adjh), text_concat(Root, 'á', Ort).

item(Index, Ort, [case==nom, gen==M, num==sg]) :- masc_neut_cz(M), define_cz(Index, Root, adjw), text_concat(Root, 'í', Ort).
item(Index, Ort, [case==gen, gen==M, num==sg]) :- masc_neut_cz(M), define_cz(Index, Root, adjw), text_concat(Root, 'ího', Ort).
item(Index, Ort, [case==dat, gen==M, num==sg]) :- masc_neut_cz(M), define_cz(Index, Root, adjw), text_concat(Root, 'ímu', Ort).
item(Index, Ort, [case==acc, gen==masca, num==sg]) :- define_cz(Index, Root, adjw), text_concat(Root, 'ího', Ort).
item(Index, Ort, [case==acc, gen==masci, num==sg]) :- define_cz(Index, Root, adjw), text_concat(Root, 'í', Ort).
item(Index, Ort, [case==acc, gen==neut, num==sg]) :- define_cz(Index, Root, adjw), text_concat(Root, 'í', Ort).
item(Index, Ort, [case==inst, gen==M, num==sg]) :- masc_neut_cz(M), define_cz(Index, Root, adjw), text_concat(Root, 'ím', Ort).
item(Index, Ort, [case==loc, gen==M, num==sg]) :- masc_neut_cz(M), define_cz(Index, Root, adjw), text_concat(Root, 'ím', Ort).
item(Index, Ort, [case==voc, gen==M, num==sg]) :- masc_neut_cz(M), define_cz(Index, Root, adjw), text_concat(Root, 'í', Ort).

item(Index, Ort, [case==C, gen==fem, num==sg]) :- case_cz(C), define_cz(Index, Root, adjw), text_concat(Root, 'í', Ort).

item(Index, Ort, [case==nom, gen==G, num==pl]) :- gen_cz(G), define_cz(Index, Root, adjw), text_concat(Root, 'í', Ort).
item(Index, Ort, [case==gen, gen==G, num==pl]) :- gen_cz(G), define_cz(Index, Root, adjw), text_concat(Root, 'ích', Ort).
item(Index, Ort, [case==dat, gen==G, num==pl]) :- gen_cz(G), define_cz(Index, Root, adjw), text_concat(Root, 'ím', Ort).
item(Index, Ort, [case==acc, gen==masca, num==pl]) :- define_cz(Index, Root, adjw), text_concat(Root, 'ích', Ort).
item(Index, Ort, [case==acc, gen==fem, num==pl]) :- define_cz(Index, Root, adjw), text_concat(Root, 'í', Ort).
item(Index, Ort, [case==acc, gen==neut, num==pl]) :- define_cz(Index, Root, adjw), text_concat(Root, 'í', Ort).
item(Index, Ort, [case==inst, gen==G, num==pl]) :- gen_cz(G), define_cz(Index, Root, adjw), text_concat(Root, 'ími', Ort).
item(Index, Ort, [case==loc, gen==G, num==pl]) :- gen_cz(G), define_cz(Index, Root, adjw), text_concat(Root, 'ích', Ort).
item(Index, Ort, [case==voc, gen==G, num==pl]) :- gen_cz(G), define_cz(Index, Root, adjw), text_concat(Root, 'í', Ort).
